﻿namespace TroubleshootingofBeanBagAssistant.lCheck
{
	public class AllowDesktopApplicationsToAccessMicrophoneCheck : IDiagnosticCheck
	{
		public string Name => "检查并修复允许桌面应用访问麦克风";

		public CheckResult Run()
		{
			if (!SystemMicrophone.IsDesktopMicrophoneAccessAllowed())
			{
				SystemMicrophone.EnableDesktopMicrophoneAccess();
				return new CheckResult
				{
					Title = "检测到桌面应用麦克风访问未开启，已自动开启",
					Detail = ""
				};
			}
			else
			{
				return new CheckResult
				{
					Title = "桌面应用麦克风访问已开启",
					Detail = "已开启"
				};
			}
		}
	}
}
